home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form BCDDemo
- Caption = "Form1"
- ClientHeight = 2655
- ClientLeft = 2865
- ClientTop = 2760
- ClientWidth = 3360
- Height = 3060
- Left = 2805
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- ScaleHeight = 2655
- ScaleWidth = 3360
- Top = 2415
- Width = 3480
- Begin CommandButton MKDCVD
- Caption = "MK&D"
- Height = 372
- Left = 2280
- TabIndex = 4
- Top = 1200
- Width = 852
- End
- Begin TextBox MKDNumber
- Height = 372
- Left = 240
- TabIndex = 8
- Text = "1234.03566"
- Top = 1200
- Width = 1812
- End
- Begin CommandButton MKSCVS
- Caption = "MK&S"
- Height = 372
- Left = 2280
- TabIndex = 3
- Top = 840
- Width = 852
- End
- Begin TextBox MKSNumber
- Height = 372
- Left = 240
- TabIndex = 7
- Text = "12.23"
- Top = 840
- Width = 1812
- End
- Begin CommandButton MKLCVL
- Caption = "MK&L"
- Height = 372
- Left = 2280
- TabIndex = 0
- Top = 480
- Width = 852
- End
- Begin TextBox MKLNumber
- Height = 372
- Left = 240
- TabIndex = 6
- Text = "23432455"
- Top = 480
- Width = 1812
- End
- Begin CommandButton MKICVI
- Caption = "MK&I"
- Height = 372
- Left = 2280
- TabIndex = 2
- Top = 120
- Width = 852
- End
- Begin TextBox MKINumber
- Height = 372
- Left = 240
- TabIndex = 1
- Text = "25186"
- Top = 120
- Width = 1812
- End
- Begin Label memo
- Height = 972
- Left = 120
- TabIndex = 5
- Top = 1680
- Width = 3252
- End
- 'These routines replace Visual Basic's "missing"
- 'binary coded decimal and IEEE string/numeric
- 'conversion routines found in QuickBASIC 4.X
- 'as well as the BASIC PDS.
- 'Marquis Computing
- DefInt A-Z
- Sub Form_Load ()
- StringToNumber
- End Sub
- Static Sub MKDCVD_Click ()
- DoingMKD = DoingMKD = 0
- If DoingMKD Then
- Number# = Val(MKDNumber.text)
- MKDNumber.text = MKD$(Number#)
- MKDCVD.caption = "CV&D"
- Else
- bcd$ = MKDNumber.text
- Number# = CVD(bcd$)
- MKDNumber.text = LTrim$(Str$(Number#))
- MKDCVD.caption = "MK&D"
- End If
- End Sub
- Static Sub MKICVI_Click ()
- DoingMKI = DoingMKI = 0
- If DoingMKI Then
- Number% = Val(MKINumber.text)
- MKINumber.text = MKI$(Number%)
- MKICVI.caption = "CV&I"
- Else
- bcd$ = MKINumber.text
- Number% = CVI(bcd$)
- MKINumber.text = LTrim$(Str$(Number%))
- MKICVI.caption = "MK&I"
- End If
- End Sub
- Static Sub MKLCVL_Click ()
- DoingMKL = DoingMKL = 0
- If DoingMKL Then
- Number& = Val(MKLNumber.text)
- MKLNumber.text = MKL$(Number&)
- MKLCVL.caption = "CV&L"
- Else
- bcd$ = MKLNumber.text
- Number& = CVL(bcd$)
- MKLNumber.text = LTrim$(Str$(Number&))
- MKLCVL.caption = "MK&L"
- End If
- End Sub
- Static Sub MKSCVS_Click ()
- DoingMKS = DoingMKS = 0
- If DoingMKS Then
- Number! = Val(MKSNumber.text)
- MKSNumber.text = MKS$(Number!)
- MKSCVS.caption = "CV&S"
- Else
- bcd$ = MKSNumber.text
- Number! = CVS(bcd$)
- MKSNumber.text = LTrim$(Str$(Number!))
- MKSCVS.caption = "MK&S"
- End If
- End Sub
- Sub StringToNumber ()
- memo.caption = "Click button to convert to/from Binary Coded Decimal. Due to VB limitation, some characters won't print."
- End Sub
-